package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HotelsOrderMapper;
import com.ruoyi.system.domain.HotelsOrder;
import com.ruoyi.system.service.IHotelsOrderService;

/**
 * 房间订单Service业务层处理
 *
 * @author Y.C
 * @date 2024-02-21
 */
@Service
public class HotelsOrderServiceImpl extends ServiceImpl<HotelsOrderMapper,HotelsOrder> implements IHotelsOrderService
{
    @Autowired
    private HotelsOrderMapper hotelsOrderMapper;

    /**
     * 查询房间订单
     *
     * @param orderId 房间订单主键
     * @return 房间订单
     */
    @Override
    public HotelsOrder selectHotelsOrderByOrderId(Long orderId)
    {
        return hotelsOrderMapper.selectHotelsOrderByOrderId(orderId);
    }

    /**
     * 查询房间订单列表
     *
     * @param hotelsOrder 房间订单
     * @return 房间订单
     */
    @Override
    public List<HotelsOrder> selectHotelsOrderList(HotelsOrder hotelsOrder)
    {
        return hotelsOrderMapper.selectHotelsOrderList(hotelsOrder);
    }

    /**
     * 新增房间订单
     *
     * @param hotelsOrder 房间订单
     * @return 结果
     */
    @Override
    public int insertHotelsOrder(HotelsOrder hotelsOrder)
    {
        hotelsOrder.setCreateTime(DateUtils.getNowDate());
        return hotelsOrderMapper.insertHotelsOrder(hotelsOrder);
    }

    /**
     * 修改房间订单
     *
     * @param hotelsOrder 房间订单
     * @return 结果
     */
    @Override
    public int updateHotelsOrder(HotelsOrder hotelsOrder)
    {
        hotelsOrder.setUpdateTime(DateUtils.getNowDate());
        return hotelsOrderMapper.updateHotelsOrder(hotelsOrder);
    }

    /**
     * 批量删除房间订单
     *
     * @param orderIds 需要删除的房间订单主键
     * @return 结果
     */
    @Override
    public int deleteHotelsOrderByOrderIds(Long[] orderIds)
    {
        return hotelsOrderMapper.deleteHotelsOrderByOrderIds(orderIds);
    }

    /**
     * 删除房间订单信息
     *
     * @param orderId 房间订单主键
     * @return 结果
     */
    @Override
    public int deleteHotelsOrderByOrderId(Long orderId)
    {
        return hotelsOrderMapper.deleteHotelsOrderByOrderId(orderId);
    }
}
